To use Perl commands inside HTML pages you need OpenScript and MacPerl (version 5).
MacPerl is controlled by OpenScript through AppleScript so you can execute Perl scripts inside HTML pages just writing the following commands in your HTML source:
...
<AppleScript>
tell application "MacPerl"
return ¬
"Days until the year 2000: " & (Do Script "
use Time::Local;
$d1 = timelocal(0,0,0,1,0,100);
$d2 = ($d1 - time()) / 60 / 60 / 24;
MacPerl::Reply(int($d2))
")
end tell
</AppleScript>
...
this simple script reports the number of days until the year 2000.
Try to examine the unregistered.script for more examples.
I suggest you to keep opened (in the background) the MacPerl application for better performance.